//
//  MessageRule_Extras.m
//  funkydog
//
//  Created by Saptarshi Guha on 1/31/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "MessageRule_Extras.h"
#import <objc/objc.h>
#import <objc/objc-runtime.h>
#import <objc/objc-class.h>


@implementation MessageRule(Extras)
+(void)load{
	if (self == [MessageRule class]){
		Method originalMethod ,replacedMethod;
		originalMethod  = class_getInstanceMethod(self, @selector(doesMessageSatisfyCriteria:));
		replacedMethod  = class_getInstanceMethod(self, @selector(mydoesMessageSatisfyCriteria:));
		method_exchangeImplementations(originalMethod, replacedMethod);
		originalMethod  = class_getInstanceMethod(self, @selector(initWithRule:));
		replacedMethod  = class_getInstanceMethod(self, @selector(myinitWithRule:));
		method_exchangeImplementations(originalMethod, replacedMethod);
	}
}
- (id)myinitWithRule:(id)fp8{
	id x=[self myinitWithRule:fp8];
	NSLog(@"%@=initwithRule:%@",x,fp8);
	return x;
}
-(BOOL)mydoesMessageSatisfyCriteria:(id)fp8{
	BOOL d=[self mydoesMessageSatisfyCriteria:fp8];
//	NSLog(@"Self=%@, Sati=%d",self,d);
	return d;
}
@end
